﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Net.Fan.SmallPig.DataAccess;
using Net.Fan.SmallPig.BusinessRules;

public partial class Comm_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string dePage = UserSettingDA.GetDefaultPage(this.User.Identity.Name);
        if (string.IsNullOrEmpty(dePage))
        {
            GotoDefault();
        }
        else
        {
            Response.Redirect(dePage);
        }


    }

    private void GotoDefault()
    {
        if (GroupDA.IsAdmin(this.User.Identity.Name))
        {
            Response.Redirect("../Admin");
        }
        else
        {
            Response.Redirect("../Job/Jobs.aspx?T=MY");
        }
    }
}
